﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PubSubLite
{
    public interface ISubscription<T> : ISubscriptionBase
    {
        void Notify(IMessage<T> message);
        /// <summary>
        /// <para>
        /// Any Func can be supplied as a lambda expression to filter out messages for the current subscription.
        /// </para>
        /// <para>
        /// PubSubLite.Bus.Subscripe&lt;MyMessage&gt;(this).ApplyFilter(x => x.Category.StartsWith("A"));
        /// </para>
        /// </summary>
        /// <param name="filterFunc"></param>
        /// <returns></returns>
        ISubscription<T> ApplyFilter(Func<IMessage<T>, bool> filterFunc);
    }
}
